package com.ruoyi.project.thirdservice.service.wx;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * GET https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code
 *
 * @author yan
 */
@FeignClient(name = "wx-api-sns", url = "https://api.weixin.qq.com/sns")
public interface WxAuthCode2SessionService {


    /**
     * Auth ==> Code换取Session
     * <p>
     * OpenID作为用户唯一标记
     *
     * @param appid
     * @param secret
     * @param jscode
     * @return
     */
    @RequestMapping(value = "/jscode2session?grant_type=authorization_code", method = RequestMethod.GET)
    Object getData(@RequestParam("appid") String appid
            , @RequestParam("secret") String secret, @RequestParam("js_code") String jscode);
}
